package com.sh.data.engine.domain.datadev.offline.model.enums;

import java.util.Objects;

/**
 * @Author: zigui.zdf @Date: 2022/2/14 14:02:44 @Description:
 */
public enum OfflineDevApiNodeTypeEnum {
    HTTP(0, "http"),
    WS(1, "ws");

    private Integer nodeType;

    private String nodeDesc;

    OfflineDevApiNodeTypeEnum(Integer nodeType, String nodeDesc) {
        this.nodeType = nodeType;
        this.nodeDesc = nodeDesc;
    }

    public String getNodeDesc() {
        return nodeDesc;
    }

    public static boolean validApiType(Integer nodeType) {
        for (OfflineDevApiNodeTypeEnum value : OfflineDevApiNodeTypeEnum.values()) {
            if (Objects.equals(value.getNodeType(), nodeType)) {
                return true;
            }
        }
        return false;
    }

    public Integer getNodeType() {
        return nodeType;
    }
}
